#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
  int m1 = 12;
  int m2 = 5;
  int m3 = m1 / m2;
  double d3 = m1 / m2;
  double d4 = (double)m1 / m2;
  printf("%d\n", m3);
  printf("%f\n", d3);
  printf("%f\n", d4);

  // %: 取余
  int n1 = 13;
  int n2 = 5;
  int k1 = n1 % n2;
  printf("%d\n", k1);

  // ++,--
  int i1 = 10;
  i1++;
  printf("%d\n", i1);
  ++i1;
  printf("%d\n", i1);
  /* int i2 = i1++;
  printf("%d\n", i2); */
  int i3 = ++i1;
  printf("%d\n", i3);

  // 随意给出一个整数，打印显示它的个位数，十位数，百位数
  /* printf("请输入一个整数：");
  int input;
  scanf("%d", &input);
  int unit = input % 10;
  int decade = input / 10 % 10;
  int hundred = input / 100;
  printf("个位数是：%d\n", unit);
  printf("十位数是：%d\n", decade);
  printf("百位数是：%d\n", hundred); */

  // 为抵抗洪水，战士连续作战8小时，编程计算共多少天零多少小时？
  int total = 89;
  int day = total / 24;
  int hour = total % 24;
  printf("战士们连续作战%d天零%d小时", day, hour);
  return EXIT_SUCCESS;
}
